--[[/**
-- * 
 * 移除生命上限
-- *
-- */]]

---@class BuffEffect475100 : BaseBuffEffect
BuffEffect475100 = ClientFight.CreateClass("BuffEffect475100", ClientFight.BaseBuffEffect)
local t = BuffEffect475100

---@param fight Fight
---@param buff FighterBuff
function t:action(fight, buff, ...)
    local parameters = {...};
    local result = parameters[3];
    if (not result:isDamage()) then
    return IBuffEffect.FAIL;
    end
    if (not AttackUtils.isDamage(result.state))then
    return IBuffEffect.FAIL;
    end
    local fightResult = parameters[3];
    local ratio = buff.buffBean.f_BuffEffectValue[1];

    local attrValue = (fightResult.damage * toRatio(ratio));
    if (attrValue == 0)then
    return IBuffEffect.FAIL;
    end
    local oldValue = buff.attributes.attributes[FighterAttributeEnum.HP.id] or 0;
    buff.attributes.attributes[FighterAttributeEnum.HP.id] = oldValue - attrValue;

    local logAddValue = attrValue;
    SkillRoleMgr.savePathFile("[" .. fight.frame .. "][EFFECT]Fighter " .. buff.target.fighterId .. " Buff:"
    .. buff.modelId .. " buff 导致生命上限发生变化: ".. logAddValue);
    ClientFight.BaseBuffEffect.action(self, fight, buff, ...);
    return IBuffEffect.SUCCESS_ATTRI_HAS_CHANGE;
end

t.New()